<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateElGiftCouponTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
       
        Schema::create('el_gift_coupon', function (Blueprint $table) {

            $table->increments('id');//

            $table->string('type')->default('');        //gift_new_user   gift_birthday   gift_recharge

            $table->integer('type_id')->default(0); 

            $table->integer('coupon_id')->default(0);    //优惠券ID

            $table->integer('num')->default(1);        //数量

            $table->tinyInteger('status')->default(1); 	 //状态：1 有效 ，0 失效

            $table->nullableTimestamps();

            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('el_gift_coupon');
    }
}
